package com.edu.zju.scs.panacea.entity.exposure;

import java.sql.Date;


/**
 * @Author: Yue Liang
 * @Date: 2019-02-08 13:35
 */
public class Exposure {
    private Long planId;
    private Date exposureDate;
    private Integer ageANum = 0;
    private Integer ageBNum = 0;
    private Integer ageCNum = 0;
    private Integer ageDNum = 0;
    private Integer ageENum = 0;
    private Integer marriageANum = 0;
    private Integer marriageBNum = 0;
    private Integer sexANum = 0;
    private Integer sexBNum = 0;
    private Integer todayAmount = 0;
    private Integer totalAmount = 0;

    public void addAgeNum(Integer age) {
        if (age == null) {
            return;
        }
        if (age <= 20) {
            ageANum ++;
        } else if (age <= 40) {
            ageBNum ++;
        } else if (age <= 60) {
            ageCNum ++;
        } else if (age <= 80) {
            ageDNum ++;
        } else {
            ageENum ++;
        }
    }

    public void addMarriageNum(Integer marriage) {
        if (marriage == null) {
            return;
        }
        if (marriage == 0) {
            marriageANum ++;
        } else {
            marriageBNum ++;
        }
    }

    public void addSexNum(Integer sex) {
        if (sex == null) {
            return;
        }
        if (sex == 0) {
            sexANum ++;
        } else {
            sexBNum ++;
        }
    }



    public void addTodayAmount() {
        this.todayAmount ++;
    }

    public Long getPlanId() {
        return planId;
    }

    public void setPlanId(Long planId) {
        this.planId = planId;
    }

    public Date getExposureDate() {
        return exposureDate;
    }

    public void setExposureDate(Date exposureDate) {
        this.exposureDate = exposureDate;
    }

    public Integer getAgeANum() {
        return ageANum;
    }

    public void setAgeANum(Integer ageANum) {
        this.ageANum = ageANum;
    }

    public Integer getAgeBNum() {
        return ageBNum;
    }

    public void setAgeBNum(Integer ageBNum) {
        this.ageBNum = ageBNum;
    }

    public Integer getAgeCNum() {
        return ageCNum;
    }

    public void setAgeCNum(Integer ageCNum) {
        this.ageCNum = ageCNum;
    }

    public Integer getAgeDNum() {
        return ageDNum;
    }

    public void setAgeDNum(Integer ageDNum) {
        this.ageDNum = ageDNum;
    }

    public Integer getAgeENum() {
        return ageENum;
    }

    public void setAgeENum(Integer ageENum) {
        this.ageENum = ageENum;
    }

    public Integer getMarriageANum() {
        return marriageANum;
    }

    public void setMarriageANum(Integer marriageANum) {
        this.marriageANum = marriageANum;
    }

    public Integer getMarriageBNum() {
        return marriageBNum;
    }

    public void setMarriageBNum(Integer marriageBNum) {
        this.marriageBNum = marriageBNum;
    }

    public Integer getTodayAmount() {
        return todayAmount;
    }

    public void setTodayAmount(Integer todayAmount) {
        this.todayAmount = todayAmount;
    }

    public Integer getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(Integer totalAmount) {
        this.totalAmount = totalAmount;
    }

    public Integer getSexANum() {
        return sexANum;
    }

    public void setSexANum(Integer sexANum) {
        this.sexANum = sexANum;
    }

    public Integer getSexBNum() {
        return sexBNum;
    }

    public void setSexBNum(Integer sexBNum) {
        this.sexBNum = sexBNum;
    }

    public void add(Exposure exposure) {
        this.ageANum += exposure.getAgeANum();
        this.ageBNum += exposure.getAgeBNum();
        this.ageCNum += exposure.getAgeCNum();
        this.ageDNum += exposure.getAgeDNum();
        this.ageENum += exposure.getAgeENum();
        this.marriageANum += exposure.getMarriageANum();
        this.marriageBNum += exposure.getMarriageBNum();
        this.sexANum += exposure.getSexANum();
        this.sexBNum += exposure.getSexBNum();
        this.todayAmount += exposure.getTodayAmount();
    }
}
